import { request } from '@gui-pkg/request';

enum Api {
  GetOne = '/api/responsible/',
  PersonnelList = '/api/responsible/page',
  AddPersonnel = '/api/responsible/save',
  FindAll = '/api/responsible/findAll',
  DeleteBatch = '/api/responsible/del/batch',
  DeletePersonnel = '/api/responsible/',
}

// 获取单个人员信息
export const getOnePersonnelData = (id) => {
  return request.get({ url: `/api/responsible/${id}` });
};

// 获取列表
export const getPersonnelList = (params) => {
  return request.get({ url: Api.PersonnelList, params });
};

// 新增编辑
export const addPersonnelData = (params) => {
  return request.post({ url: Api.AddPersonnel, params });
};

// 获取所有数据
export const getAllPersonnelData = (params) => {
  return request.get({ url: Api.FindAll, params });
};

// 批量删除
export const deleteBatchPersonnelData = (params) => {
  return request.post({ url: Api.DeleteBatch, params });
};

// 删除人员
export const deletePersonnelData = (params) => {
  return request.delete({ url: Api.DeletePersonnel + params });
};
